{include file='/public/header'}

<div class="am-cf admin-main">
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">添加文章</strong> / <small>add article</small></div>
            </div>

            <hr/>

            <div class="am-g">
                <div class="am-u-lg-12">
                    <form class="am-form" action="{:url('/admin/article/add_new')}" method="post">
                        <input type="hidden" name="doc_id" value="{$doc_id}" />
                        <div class="am-form-group am-form-inline am-g">
                            <div class="am-u-lg-4">
                                <input type="text" id="title" name="title" placeholder="请输入文章标题">
                            </div>
                            {if(!$doc_id)}
                            <div class="am-u-lg-3">
                                <label class="am-form-label">所属分类</label>
                                <select id="category_id" name="category_id" data-am-selected="{btnWidth:'38%',btnSize:'md'}">
                                    <option value="0">选择一级分类</option>
                                    {foreach $top_categories as $category}
                                    <option value="{$category.id}">{$category.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                            {/if}
                            <div class="am-u-lg-2">
                                <input type="text" id="sort" name="sort" placeholder="可选：顺序数字">

                            </div>
                            <div class="am-u-lg-3">
                                <button type="submit" class="am-btn am-btn-primary">保存</button>
                                <button type="button" class="am-btn am-btn-danger">取消</button>
                                <label class="am-checkbox-inline"><input type="checkbox" checked="checked" id="is_publish" name="is_publish" value="1">发布</label>
                            </div>
                        </div>
                        <div id="editor"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- content end -->
</div>
{include file='/public/footer'}
<script src="/static/common/editor.md/editormd.js"></script>
<link rel="stylesheet" href="/static/common/editor.md/css/editormd.css" />
<script>
    window.phpby.main.editor('editor');
</script>